<?php
App::uses('AppModel', 'Model');
/**
 * TarifCalcule Model
 *
 * @property Question $question
 */
class TarifCalcule extends AppModel {

	function peterLeTarifCalcule($id) {
		$this->query("DELETE FROM tarif_calcules WHERE id_tarif = ".$id);
	}
	
	
	public function insertRegleTarif($id_tarif, $coeff, $id_question) {
		$result = $this->query("INSERT INTO tarif_calcules (id_tarif, coefficient_tarif, id_question) VALUES (".$id_tarif.", ".$coeff.", ".$id_question.")");
	}
	
/**
 * Primary key field
 *
 * @var string
 */
	public $primaryKey = 'id_tarif';
/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'coefficient_tarif';

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * hasOne associations
 *
 * @var array
 */
	public $hasOne = array(
		'question' => array(
			'className' => 'Question',
			'foreignKey' => 'id_question',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
